﻿<div class="row" ng-controller="referenciaComprobanteController">
    <form class="form-horizontal" ng-submit="save()" name="referenciaComprobanteForm" ng-show="formVisibility" novalidate>
        <div class=" form-group">
            <label class="control-label col-xs-1">Base : </label>
            <div class="col-xs-2">
                <select ng-model="referenciaComprobante.Base1Id" class="form-control"
                        ng-options="value.Id as value.Serie for value in base1List">
                    <option>--</option>
                </select>{{referenciaComprobante.Base1Id}}
            </div>
            <label class="control-label col-xs-1">Fecha:</label>
            <div class="col-xs-2">
                <input type="date" class="form-control" ng-model="referenciaComprobante.Fecha" required>
            </div>
            <label class="control-label col-xs-1">Serie:</label>
            <div class="col-xs-2">
                <input type="text" class="form-control" placeholder="Serie" ng-model="referenciaComprobante.Serie" required>
            </div>
            <label class="control-label col-xs-1">Comprobante:</label>
            <div class="col-xs-2">
                <input type="text" class="form-control" placeholder="Numero" ng-model="referenciaComprobante.N_Comprobante" required>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-1">Tabla 10:</label>
            <div class="col-xs-12 ">
                <select ng-model="referenciaComprobante.Tabla10Id" class="form-control"
                        ng-options="value.Id as value.Descripcion for value in tabla10List  ">
                    <option>--</option>
                </select>
                <p>Select: {{referenciaComprobante.Tabla10Id}}</p>
            </div>
        </div>
        <br>
        <div class="form-group">
            <div class="col-xs-offset-9">
                <button type="button" class="btn btn-default" ng-click="cancel()">Cancel </button>
                <button class="btn btn-success" type="submit" ng-disabled="referenciaComprobanteForm.$invalid">Save</button>
                <input type="reset" class="btn btn-default btn-primary" value="Limpiar">
            </div>
        </div>
    </form>
    <div class="container">
        <h3>LISTA DE REFERENCIA DE COMPROBANTES</h3>
        <table class="table table-striped table-bordered">
            <tr>
                <th>Tabla 2</th>
                <th>Numero</th>
                <th>Razon Social</th>
                <th>Comprobante</th>
                <th>Opciones</th>
            </tr>

            <tr ng-repeat="d in list">
                <td>{{d.Base1Id}}</td>
                <td>{{d.Fecha}}</td>
                <td>{{d.Serie}}</td>
                <td>{{d.N_Comprobante}}</td>
                <td>
                    <button ng-click="getById(d)" type="button" class="btn btn-primary"><i class="glyphicon glyphicon-pencil"></i> <span>Editar</span></button>
                    <button ng-click="delete(d)" type="button" class="btn btn-danger"><i class="glyphicon glyphicon-trash"></i> <span>Eliminar</span></button>
                </td>

            </tr>
        </table>
    </div>
    <button ng-click="ShowForm()" ng-hide="formVisibility" type="button" class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i> Agregar Referencia de Comprobante...</button>
</div>
